import request from '@/router/axios';

//获取动作库树状结构
export const actTreeList = () => {
    return request({
        url: '/library/common-tech-classify/tree',
        method: 'get',
    })
}

//获取动作库节点类型
export const getTypeList = (params) => {
    return request({
        url: '/base/structure-relate-rule/list',
        method: 'get',
        params 
    })
}
//获取动作库list
export const getsport = (params) => {
    return request({
        url: '/library/action-classify/list',
        method: 'get',
        params
    })
}
//获取动作库要领
export const getsportYl = (params) => {
    return request({
        url: '/library/action-essentials/list',
        method: 'get',
        params
    })
}
//获取动作库父级节点类型
export const getactionList = (params) => {
    return request({
        url: '/library/common-tech-classify/list',
        method: 'get',
        params
    })
}

//获取动作库表格数据
export const actDataList = (params) => {
    return request({
        url: '/library/common-tech-classify/page',
        method: 'get',
        params:{
            ...params
        }
    })
}

//动作库左侧树状结构新增
export const addatreeList = (data) => {
    return request({
        url: '/library/common-tech-classify/add',
        method: 'post',
        data:{
         name:data.nodeName, 
         code:data.nodeEncoding, 
         parentId:data.parentNode, 
         type:data.nodeType, 
        }   
    })
}

//动作库左侧树状结构编辑
export const updateatreeList = (data) => {
    return request({
        url: '/library/common-tech-classify/update',
        method: 'post',
        data:{
            name:data.nodeName, 
            code:data.nodeEncoding, 
            parentId:data.parentNode, 
            type:data.nodeType, 
            id:data.id
        }
    })
}

//动作库左侧树状结构删除
export const removeatreeList = (id) => {
    return request({
        url: '/library/common-tech-classify/delete',
        method: 'post',
        data:{
            id
        }
    })
}



